<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>

<?php 
	$ci = &get_instance();
	$USER = getAccountUserObject();
	$ESCORT = $ci->escort_entity->init('user_id',$USER->getId());	
?>


<div class="dashboard-info-wrapper">
	<fieldset>
		 <legend><?php echo language_translate('pictures_videos_public_top_media');?></legend>
		 <div id="public_top_media">
			<?php $media_array= $ci->media_entity->getMediaByPermission($ESCORT->getId(), 'public_top');?>
			<?php foreach($media_array as $item):?>
				<?php $MEDIA = $ci->media_entity->init('id',$item->id);?>
					<?php if($MEDIA->getType() == 'image'):?>
						<div class="media-item ui-state-default" id="<?php echo $item->id;?>" title="<?php echo language_translate('pictures_videos_title');?>" rel="image">
							<?php echo thumb($MEDIA->getTargetFileImageTopPublic('big'),THUMB_W,THUMB_H);?>
							<div class="media-edit"><?php echo language_translate('pictures_videos_media_edit');?></div>
						</div>
					<?php else:?>
						<div class="media-item ui-state-default" id="<?php echo $item->id;?>" title="<?php echo language_translate('pictures_videos_title');?>" rel="video">
							<?php echo thumb($MEDIA->getTargetFile('avatar'),THUMB_VW,THUMB_VH);?>
							<div class="media-edit"><?php echo language_translate('pictures_videos_media_edit');?></div>
						</div>
					<?php endif;?>
			<?php endforeach;?>
		 </div>
	</fieldset>
	<div class="clear"></div>
</div>

<div class="dashboard-info-wrapper">
	<fieldset>
		 <legend><?php echo language_translate('pictures_videos_public_media');?></legend>
		 <div id="public_medias">
			<?php $media_array= $ci->media_entity->getMediaByPermission($ESCORT->getId(), 'public');?>
			<?php foreach($media_array as $item):?>
				<?php $MEDIA = $ci->media_entity->init('id',$item->id);?>
					<?php if($MEDIA->getType() == 'image'):?>
						<div class="media-item ui-state-default" id="<?php echo $item->id;?>" title="<?php echo language_translate('pictures_videos_title');?>" rel="image">
							<?php echo thumb($MEDIA->getTargetFileImageTopPublic('big'),THUMB_W,THUMB_H);?>
							<div class="media-edit"><?php echo language_translate('pictures_videos_media_edit');?></div>
						</div>
					<?php else:?>
						<div class="media-item ui-state-default" id="<?php echo $item->id;?>" title="<?php echo language_translate('pictures_videos_title');?>" rel="video">
							<?php echo thumb($MEDIA->getTargetFile('avatar'),THUMB_VW,THUMB_VH);?>
							<div class="media-edit"><?php echo language_translate('pictures_videos_media_edit');?></div>
						</div>
					<?php endif;?>
			<?php endforeach;?>
		 </div>
	</fieldset>
	<div class="clear"></div>
</div>

<div class="dashboard-info-wrapper">
	<fieldset>
		 <legend><?php echo language_translate('pictures_videos_private_media');?></legend>
		 <div id="private_medias">
			<?php $media_array= $ci->media_entity->getMediaByPermission($ESCORT->getId(), 'private');?>
			<?php foreach($media_array as $item):?>
				<?php $MEDIA = $ci->media_entity->init('id',$item->id);?>
					<?php if($MEDIA->getType() == 'image'):?>
						<div class="media-item ui-state-default" id="<?php echo $item->id;?>" title="<?php echo language_translate('pictures_videos_title');?>" rel="image">
							<?php echo thumb($MEDIA->getTargetFileImageTopPublic('big'),THUMB_W,THUMB_H);?>
							<div class="media-edit"><?php echo language_translate('pictures_videos_media_edit');?></div>
						</div>
					<?php else:?>
						<div class="media-item ui-state-default" id="<?php echo $item->id;?>" title="<?php echo language_translate('pictures_videos_title');?>" rel="video">
							<?php echo thumb($MEDIA->getTargetFile('avatar'),THUMB_VW,THUMB_VH);?>
							<div class="media-edit"><?php echo language_translate('pictures_videos_media_edit');?></div>
						</div>
					<?php endif;?>
			<?php endforeach;?>
		 </div>
	</fieldset>
	<div class="clear"></div>
</div>

<?php exit; ?>